package com.dwxt.sport.business.entity;

import com.dwxt.sport.util.DictUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "t_index_device_info")
public class IndexDeviceInfo {

    @Id
    private String id;

    /**
     * 设备分类(关联数据字典【classification】)
     */
    @ApiModelProperty("设备分类(关联数据字典【classification】)")
    private String classification;

    @ApiModelProperty("设备分类Display")
    public String getClassificationDisplay(){
        return classification==null?null: DictUtil.getDisplay("classification",classification);
    }

    /**
     * 设备数量
     */
    @Column(name = "equipment_number")
    @ApiModelProperty("设备数量")
    private Integer equipmentNumber;

    /**
     * 启用数量
     */
    @Column(name = "enable_amount")
    @ApiModelProperty("启用数量")
    private Integer enableAmount;

    /**
     * 监测异常的数量
     */
    @Column(name = "anomaly_count")
    @ApiModelProperty("监测异常的数量")
    private Integer anomalyCount;

    /**
     * 是否报警(0:否;1:是)
     */
    @Column(name = "is_alarm")
    private String isAlarm;

    /**
     * 逻辑删除标识(0否1是)
     */
    @Column(name = "is_delete")
    private String isDelete;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @Column(name = "create_user_id")
    private String createUserId;

    /**
     * (最近)更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty("(最近)更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime updateTime;

    /**
     * 更新人id
     */
    @Column(name = "update_user_id")
    private String updateUserId;

    /**
     * 备用字段1
     */
    private String attr1;

    /**
     * 备用字段2
     */
    private String attr2;

    /**
     * 备用字段3
     */
    private String attr3;



}